package com.aeasycredit.credit.tuef.handler;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.aeasycredit.credit.tuef.constant.TuefContactNumberSegmentEnum;
import com.aeasycredit.credit.tuef.constant.TuefSegment;
import com.aeasycredit.credit.tuef.model.TuefContact;
import com.aeasycredit.credit.tuef.service.TuefContactService;

@Component
public class TuefContactDataHandler implements TuefDataHandler<List<TuefContact>> {
    
    @Autowired
    private TuefContactService tuefContactService;

    @Override
    public List<TuefContact> getData(String tuefBasicId) {
        return tuefContactService.getListByTuefBasicId(tuefBasicId);
    }

    @Override
    public Class<? extends TuefSegment> supportTuefSegment() {
        return TuefContactNumberSegmentEnum.SEGMENT_TAG.getClass();
    }
    
    @Override
    public TuefSegment[] supportSegmentFields() {
        return TuefContactNumberSegmentEnum.values();
    }
}
